home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c / 205 < prev    next >
Encoding:
Text File  |  1996-08-06  |  1.9 KB  |  49 lines

  1. Path: solon.com!not-for-mail
  2. From: seebs@solutions.solon.com (Peter Seebach)
  3. Newsgroups: comp.lang.c,comp.std.c
  4. Subject: Re: Integral conversion e.t.c. (was: Re: Hungarian notation)
  5. Date: 27 Jan 1996 12:22:26 -0600
  6. Organization: Usenet Fact Police (Undercover)
  7. Message-ID: <4edqh2$rvl@solutions.solon.com>
  8. References: <30C40F77.53B5@swsbbs.com> <SPENCER.96Jan22113215@zorgon.ERA.COM> <KANZE.96Jan26164833@gabi.gabi-soft.fr> <DLtABq.Fzu@mv.mv.com>
  9. NNTP-Posting-Host: solutions.solon.com
  10.  
  11. In article <DLtABq.Fzu@mv.mv.com>, Michael Furman <ENGR@GSSI.MV.COM> wrote:
  12. [Re a rule forbidding extensions.]
  13.  
  14. >My question was: is such rule exists?
  15.  
  16. Sort of.
  17.  
  18. There are two kinds of things called "legal" C.  One is a strictly
  19. conforming program, which must be accepted by, and work on, *any*
  20. conforming C compiler.  The other is merely a conforming
  21. program, which must be accepted by, and work on, *at least one*
  22. conforming compiler.  The latter class is meaningless; FORTRAN is
  23. conforming C.  (gcc with g77 compiles it.  Technically, gcc is not
  24. quite conforming, but nothing is.)
  25.  
  26. For purposes of the C newsgroups, discussion of what is/isn't legal
  27. is generally restricted to strictly conforming C.  Any extension
  28. used allows a compiler to reject code.  For instance, a compiler
  29. is *allowed* to reject
  30.     int main(int ac, char *av[], char *ep[]) {
  31.         return 0;
  32.     }
  33. so we say it is "not legal C".  A compiler *MUST* accept
  34.     int main(int far, char *near[]) {
  35.         int asm;
  36.         asm = !!far;
  37.         return asm;
  38.     }
  39. and its return status is defined.  If a compiler were to reject it because,
  40. for instance, asm, far, and near are used as variables, it would not be
  41. a legal implementation.
  42.  
  43. -s
  44. -- 
  45. Peter Seebach - seebs@solon.com - Copyright 1995 Peter Seebach.
  46. C/Unix wizard -- C/Unix questions? Send mail for help.  No, really!
  47. Using trn?  Weird new newsgroup problem?  I know the fix!  Email me!
  48. The *other* C FAQ - ftp taniemarie.solon.com /pub/c/afq - Not A Flying Toy
  49.